﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ITree.cs" company="Team Awesome">
//   Awesome
// </copyright>
// <summary>
//   Defines the ITree type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace System.Collections.Generic
{
    /// <summary>
    /// The generic interface for a tree collection
    /// </summary>
    /// <typeparam name="T">
    /// T can be any type.
    /// </typeparam>
    public interface ITree<T> : ICollection<T>
    {
        /// <summary>
        /// Returns the item for the index i.
        /// </summary>
        /// <param name="index">
        /// The index.
        /// </param>
        /// <returns>
        /// The item for the index i.
        /// </returns>
        T GetItem(T index);

        /// <summary>
        /// Returns a snapshot of the tree, if the tree isn't already a snapshot itself. Else it will throw an exception!
        /// </summary>
        /// <returns>
        /// A snapshot of the tree, if the tree isn't already a snapshot itself.
        /// </returns>
        ITree<T> Snapshot();
    }
}